<template>
    <div class="box">
        <div class="header">头部</div>
        <div class="meddle">
            <li v-for="item in list" :key="item.id">
                <img :src="item.image" alt="" style="width: 100%;" @click="$router.push('/detail/' + item.id)">
                <p>{{ item.title }}</p>
                <p style="color: red;">￥{{ item.price }}</p>
            </li>
        </div>
        <van-submit-bar :price="500050" button-text="提交订单" @submit="onSubmit">
            <van-checkbox v-model="checked">全选</van-checkbox>
            
        </van-submit-bar>
    </div>
</template>
<script setup>
import request from '@/utils/request.js'
import { ref, onMounted } from "vue";
const list = ref([])
onMounted(() => {
    request.get('/list', {
        params: {
            pagination: 1, pageNum: 40
        }
    }).then(res => {
        if (res.data.code == 200) {
            list.value = res.data.data
        }
    })
})
</script>